package suery.syntax;

import java.awt.Component;

import suery.ComponentTreeNode;
/**
 * This parser will find the node in which the wrapped component is the refer one.
 * @author Jeky
 *
 */
public class SearchByRefParser extends AbstractSearchParser {

    private final Component component;

    public SearchByRefParser(Component component) {
        this.component = component;
    }

    @Override
    protected boolean accept(String token, ComponentTreeNode node) {
        return component == node.getComponent();
    }

}